sched: fix locking of remove_vcpu() in credit1
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 6 Nov 2015 14:16:38 +0000 (15:16 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Nov 2015 14:16:38 +0000 (15:16 +0100)
commit897cc6d07acd3e66356f021c5f7f9a49ef061d5d
treeb47ea204c9d3c07325c0df8cee31aad2f5953534
parentacd9bd133c04766b8457f55e072c39f38eec5a43
sched: fix locking of remove_vcpu() in credit1

In fact, csched_vcpu_remove() (i.e., the credit1
implementation of remove_vcpu()) manipulates runqueues,
so holding the runqueue lock is necessary.

However, the vCPU just can't be on the runqueue, when
the function is called. We can therefore ASSERT() that,
and avoid doing any runqueue manipulations (rather than
adding the runqueue locking around it).

Also, while there, *_lock_irq() (for the private lock) is
enough, there is no need to *_lock_irqsave().

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit.c